#ifndef __IL_GRAPH_BASE_H__
#define __IL_GRAPH_BASE_H__

#include "ILGlobal.h"



typedef void (*il_sysevt_hdlr)(ILINT message, ILINT param);
typedef void (*il_keyevt_hdlr)(ILINT event, ILINT keycode);
typedef void (*il_penevt_hdlr)(ILINT event, ILINT x, ILINT y);

typedef struct __DEMO_APP__
{
	ILINT lcd_x, lcd_y;
	ILINT lcd_w, lcd_h;

	ILINT layer_hdl[1];

	il_sysevt_hdlr sysevt_hdlr;
	il_keyevt_hdlr keyevt_hdlr;
	il_penevt_hdlr penevt_hdlr;
}DEMO_APP;

extern DEMO_APP s_demo_app;

/*
get layer handle by layer buffer
*/
ILINT il_get_layer_hdlr_by_buffer(ILUINT8* buffer);


/*
get app instance pointer
*/
DEMO_APP* il_get_app_instance(void);


/************************************************************************/
/* external function                                                    */
/************************************************************************/

/*
 *	set layer clip area
 */
extern il_ret il_set_layer_clip_ex(ILINT layer, const il_rect* area_p);

/*
 *	get clip area
 * @param[in]: clip_p
 */
extern void il_get_global_clip(il_rect* clip_p);

extern void il_reset_layer_clip(ILINT layer);

extern void il_fill_rect(ILUINT8* buf, const il_rect* area_p, ILUINT16 line_color, ILUINT16 fill_color);

extern void il_disable_flush(void);

extern void il_enable_flush(void);

void il_flush(void);


#endif/*__IL_GRAPH_BASE_H__*/